// 记录当前所在分类
import { REMOVE_CATEGORY, SET_CATEGORY } from '../constant';

const initValue = {};

export default function category (prev = initValue, action) {
  const {
    type,
    data
  } = action;
  switch (type) {
  case SET_CATEGORY:
    return data;
  case REMOVE_CATEGORY:
    return {};
  default:
    return prev;
  }
}
